<template>
  <BasicTable :columns="columns" :data-source="tableData" :isRowSelection="false">
    <template #bodyCell="{ column, record }">
      <template v-if="column.dataIndex === 'classifySubclasses'">
        <span>{{ record.category }}</span>
        <span v-if="record.sub_category">{{ record.sub_category }}</span>
        <!-- <BindingClassificationText :value="record.classifySubclassesVal" v-if="record.isBind === 0" /> -->
      </template>

      <template v-if="column.dataIndex === 'status'">
        <CollectState :value="record.status" :collect-state="COLLECT_START_STATE_3" />
      </template>
    </template>
  </BasicTable>
</template>

<script lang="ts" setup name="SeedSourceMovieTable">
import BasicTable from '../../../../components/BasicTable.vue'
import BindingClassificationText from '../../../../components/binding-classification/BindingClassificationText.vue'
import CollectState from '../../../../components/CollectState.vue'
import { COLLECT_START_STATE_3, filterSelectSource } from '@/stores/modules/collect-manage/select-data-source'
import { getTableData, tableData } from '../../../../hooks/useTable'
import { computed } from 'vue'

getTableData()

const columns = [
  {
    title: '内容ID',
    dataIndex: 'id'
  },
  {
    title: '影片名称',
    dataIndex: 'name'
  },
  {
    title: '分类/子类',
    dataIndex: 'classifySubclasses'
  },
  {
    title: '线路来源',
    dataIndex: 'lineSource'
  },
  {
    title: '数据处理',
    dataIndex: 'data_type'
  },
  {
    title: '采集状态',
    dataIndex: 'status'
  }
]

type TableData = {
  id: number
  name: string
  category: string
  sub_category: string
  lineSource: string
  data_type: string
  SeedSourceIdentification: string
  status: number
  collect_time: number
}[]

const NEW_COLLECT_START_STATE_3 = computed(() => {
  let filterValues: number[] = [0]
  return filterSelectSource(COLLECT_START_STATE_3, filterValues)
})
</script>
